﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="querymessages.aspx.cs" Inherits="linkDATABASE.留言查询.querymessages" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="referrer" content="no-referrer" />
    <link rel="icon" href="http://icons.iconarchive.com/icons/chanut/role-playing/256/Monster-icon.png">


    <title>房间列表</title>

    <style>

    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div class="container">
            <h2>留言列表</h2>
            <asp:ListView ID="ListView1" runat="server" DataKeyNames="房号" DataSourceID="SqlDataSource1" InsertItemPosition="LastItem">
                <AlternatingItemTemplate>
                    <tr style="background-color:#FFF8DC;">
                        <td></td>
                        <td>
                            <asp:Label ID="房号Label" runat="server" Text='<%# Eval("房号") %>' />
                        </td>
                        <td>
                            <asp:Label ID="房形Label" runat="server" Text='<%# Eval("房形") %>' />
                        </td>
                        <td>
                            <asp:Label ID="房态Label" runat="server" Text='<%# Eval("房态") %>' />
                        </td>
                        <td>
                            <asp:Label ID="预订状态Label" runat="server" Text='<%# Eval("预订状态") %>' />
                        </td>
                        <td>
                            <asp:Label ID="床位数Label" runat="server" Text='<%# Eval("床位数") %>' />
                        </td>
                        <td>
                            <asp:Label ID="所处位置Label" runat="server" Text='<%# Eval("所处位置") %>' />
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <EditItemTemplate>
                    <tr style="background-color:#008A8C;color: #FFFFFF;">
                        <td>
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="更新" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="取消" />
                        </td>
                        <td>
                            <asp:Label ID="房号Label1" runat="server" Text='<%# Eval("房号") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="房形TextBox" runat="server" Text='<%# Bind("房形") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="房态TextBox" runat="server" Text='<%# Bind("房态") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="预订状态TextBox" runat="server" Text='<%# Bind("预订状态") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="床位数TextBox" runat="server" Text='<%# Bind("床位数") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="所处位置TextBox" runat="server" Text='<%# Bind("所处位置") %>' />
                        </td>
                    </tr>
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <table runat="server" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                        <tr>
                            <td>未返回数据。</td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="插入" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="清除" />
                        </td>
                        <td>
                            <asp:TextBox ID="房号TextBox" runat="server" Text='<%# Bind("房号") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="房形TextBox" runat="server" Text='<%# Bind("房形") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="房态TextBox" runat="server" Text='<%# Bind("房态") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="预订状态TextBox" runat="server" Text='<%# Bind("预订状态") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="床位数TextBox" runat="server" Text='<%# Bind("床位数") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="所处位置TextBox" runat="server" Text='<%# Bind("所处位置") %>' />
                        </td>
                    </tr>
                </InsertItemTemplate>
                <ItemTemplate>
                    <tr style="background-color:#DCDCDC;color: #000000;">
                        <td></td>
                        <td>
                            <asp:Label ID="房号Label" runat="server" Text='<%# Eval("房号") %>' />
                        </td>
                        <td>
                            <asp:Label ID="房形Label" runat="server" Text='<%# Eval("房形") %>' />
                        </td>
                        <td>
                            <asp:Label ID="房态Label" runat="server" Text='<%# Eval("房态") %>' />
                        </td>
                        <td>
                            <asp:Label ID="预订状态Label" runat="server" Text='<%# Eval("预订状态") %>' />
                        </td>
                        <td>
                            <asp:Label ID="床位数Label" runat="server" Text='<%# Eval("床位数") %>' />
                        </td>
                        <td>
                            <asp:Label ID="所处位置Label" runat="server" Text='<%# Eval("所处位置") %>' />
                        </td>
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <table runat="server">
                        <tr runat="server">
                            <td runat="server">
                                <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                    <tr runat="server" style="background-color:#DCDCDC;color: #000000;">
                                        <th runat="server"></th>
                                        <th runat="server">房号</th>
                                        <th runat="server">房形</th>
                                        <th runat="server">房态</th>
                                        <th runat="server">预订状态</th>
                                        <th runat="server">床位数</th>
                                        <th runat="server">所处位置</th>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr runat="server">
                            <td runat="server" style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                                <asp:DataPager ID="DataPager1" runat="server">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <SelectedItemTemplate>
                    <tr style="background-color:#008A8C;font-weight: bold;color: #FFFFFF;">
                        <td></td>
                        <td>
                            <asp:Label ID="房号Label" runat="server" Text='<%# Eval("房号") %>' />
                        </td>
                        <td>
                            <asp:Label ID="房形Label" runat="server" Text='<%# Eval("房形") %>' />
                        </td>
                        <td>
                            <asp:Label ID="房态Label" runat="server" Text='<%# Eval("房态") %>' />
                        </td>
                        <td>
                            <asp:Label ID="预订状态Label" runat="server" Text='<%# Eval("预订状态") %>' />
                        </td>
                        <td>
                            <asp:Label ID="床位数Label" runat="server" Text='<%# Eval("床位数") %>' />
                        </td>
                        <td>
                            <asp:Label ID="所处位置Label" runat="server" Text='<%# Eval("所处位置") %>' />
                        </td>
                    </tr>
                </SelectedItemTemplate>
            </asp:ListView>
            <br />
            <br />

        </div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:HotelConnectionString %>" SelectCommand="SELECT * FROM [Roominfo]" DeleteCommand="DELETE FROM [Roominfo] WHERE [房号] = @房号" InsertCommand="INSERT INTO [Roominfo] ([房号], [房形], [房态], [预订状态], [床位数], [所处位置]) VALUES (@房号, @房形, @房态, @预订状态, @床位数, @所处位置)" UpdateCommand="UPDATE [Roominfo] SET [房形] = @房形, [房态] = @房态, [预订状态] = @预订状态, [床位数] = @床位数, [所处位置] = @所处位置 WHERE [房号] = @房号" OnSelecting="SqlDataSource1_Selecting">
            <DeleteParameters>
                <asp:Parameter Name="房号" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="房号" Type="Int32" />
                <asp:Parameter Name="房形" Type="String" />
                <asp:Parameter Name="房态" Type="String" />
                <asp:Parameter Name="预订状态" Type="String" />
                <asp:Parameter Name="床位数" Type="Int32" />
                <asp:Parameter Name="所处位置" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="房形" Type="String" />
                <asp:Parameter Name="房态" Type="String" />
                <asp:Parameter Name="预订状态" Type="String" />
                <asp:Parameter Name="床位数" Type="Int32" />
                <asp:Parameter Name="所处位置" Type="String" />
                <asp:Parameter Name="房号" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
